Skip to content

fix(core,fountain): --approver on chant approve, the fountain approve re-run, and --profile back on chant run (#2192) - #2197

Merged
lex00 merged 1 commit into
mainfrom
fix/2192-approve-profile-fountain-rerun
Sep 7, 2026
Merged

lex00 merged 1 commit into
mainfrom
fix/2192-approve-profile-fountain-rerun

Conversation

@lex00

@lex00 lex00 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2192.

Sub-issue 1 of #2191: the seven findings that are behaviour rather than prose. Each was proven against main at 4853da2 and re-read before editing.

The seven fixes

chant approve --approver recorded the wrong person. runApprove in packages/core/src/cli/handlers/operator.ts handed only ctx.args.actor to recordGateApproval, and recordGateApproval falls through to $GITHUB_ACTOR, $GITLAB_USER_LOGIN or $USER when that is absent. --approver was parsed and then thrown away, so every example README that teaches --approver you wrote the shell user onto the ledger. The getting-started transcript shows exactly that: [approved] alex under its own --approver you. The handler now reads approver ?? actor, the precedence chant run approve has applied since #2126, and the READMEs stay as written. The stale --approver docstring in registry.ts, which described the flag as riding a chant run signal payload into workflow history, now says what the flag does.

chant run approve --on fountain never re-applied the op. The fountain runtime's resolveGate posted the prompt chant run approve <op> <gate> onto the steward's thread under a comment saying it re-runs the op. The ACP command parser in lexicons/fountain/src/acp/command-line.ts only classifies a prompt as kind: "op-run" when the command is run with a path and no compound verb; run approve is a registered compound, so it parsed as a verb, runOpApprove wrote the same resolution a second time on the sandbox's local runtime, and the sandbox printed "re-run chant run <op>" at nobody. The prompt is now chant run <op>, which parses as an op run, and the re-run decides the gate from the ledger through evaluateGate in packages/core/src/op/gate.ts. --approver and --url still ride along so the thread names who resolved the gate. The two error messages that called it "the approve prompt" now call it the re-run prompt.

--profile did not exist. Commit 257ca0c deleted -p/--profile from the parser with a message claiming nothing outside the Temporal paths read it, but #2124 had already documented it for fountain, and three fountain pages plus the skill still teach it. The flag is back in parseArgs and in ParsedArgs, OpRunStartOptions grows a profile field, runOpOnRuntime passes it, and the fountain runtime selects that profile before it opens its connection. It keeps the refusal #2124 shipped: a name that is not under fountain.profiles is an error rather than a silent fall back to defaultProfile, so a misspelt profile cannot run against the wrong instance. profiles.mdx loses its two temporal.profiles comparisons; runtime.mdx:40 and chant-fountain-ops.md:89 were already true and are untouched.

test/azure-drift-e2e.sh generated a config that cannot load. It wrote lexicons: ["azure", "temporal"], naming a lexicon that no longer resolves, and taskQueue: "azure-drift-e2e" into an Op whose config has no such field. Both are gone.

The OperatorStack refusal cited the wrong rule and argued from a retired premise. deriveHostVerbClass threw "(TMP014; the local dispatch executor can't honor its required gate)" and then advised remediating "manually via a gated op", which contradicts the reason it just gave. The rule is OPS014, and its own header records that #2119 retired the executor argument: a gated op ends the run gated rather than being refused, so the refusal stands on the unattended-approval ground instead. The message now names OPS014 and gives that reason. The other TMP014 comment citations in the same file (lines 40, 44, 49, 107, 201) belong to #2195 and are untouched.

--durable-requests was documented as honoured. Its only implementation throws, pending managoat/managoat#1635. The cli/run.mdx flag table row and the registry.ts docstring now read as reserved and name the upstream issue, consistent with what cli/run.mdx:55 already said.

The MCP context bundle served agents false ground truth. It said chant://ops returns taskQueue (the handler returns labels), that chant://ops/{name}/runs is workflow run history (it is the run ledger), and that ops carry deterministic workflow ids chant-op-<opName>, which do not exist. The bundle now matches resource-handlers.ts and the Workflow IDs section is gone. The tracked diagram source docs/diagrams/agent-integration-surfaces.ir.json and both SVGs showed op-signal, renamed op-approve in mcp/op-tools.ts, and "durable · observable · gate-able".

Acceptance

  • chant approve <op> <gate> --approver you records you on the gate ledger, with a test. packages/core/src/cli/handlers/operator.ts:557 (actor: ctx.args.approver ?? ctx.args.actor); test "--approver wins over --actor and over the CI/shell identity" in operator.test.ts, which stubs GITHUB_ACTOR=ci-bot and USER=alex and asserts resolvedBy: "you".
  • chant run approve <op> <gate> --on fountain posts chant run <op> with the approver and url, with a test on the prompt text; the three docs pages and the getting-started walkthrough describe what happens. lexicons/fountain/src/op/runtime.ts:888 (const parts = [\chant run ${op}`]); tests "posts the op's re-run prompt with the approver and the url" and "the posted prompt parses as an op run, not as a verb" in runtime.test.ts. Pages: tutorials/fountain-steward.mdx:183, cli/run.mdx:55, guide/operator.mdx:147, plus lexicons/fountain/docs/pages/runtime.mdx:77andsrc/skills/chant-fountain-ops.md:121, which said the same stale thing. examples/getting-started/README.md:226drops the redundant localchant approveand closes withchant run status --on fountain`.
  • chant run <op> --on fountain --profile <name> selects that profile, with a test; the three fountain pages and the skill stay accurate. packages/core/src/cli/main.ts:196, registry.ts:40 (profile?: string), op/runtime.ts:152 (OpRunStartOptions.profile), handlers/run.ts:767, lexicons/fountain/src/op/runtime.ts:732 (selectProfile(startOpts.profile)). Tests: "-p/--profile carries the runtime's connection profile" in main.test.ts, "--profile reaches the hosting runtime's start options" and "without --profile the runtime is left to its own default" in run.test.ts, "--profile on the run selects that profile's endpoint, token and team" and "--profile naming an undeclared entry is refused on the run" in the fountain runtime.test.ts. profiles.mdx rewritten at lines 7, 43 and 76; runtime.mdx:40 and chant-fountain-ops.md:89 were already true and stay as they are.
  • test/azure-drift-e2e.sh generates a config with no temporal lexicon and no taskQueue. test/azure-drift-e2e.sh:101 is now lexicons: ["azure"], and the taskQueue: line under Op({ name: "deploy" ...}) is deleted.
  • The OperatorStack error names OPS014 and describes gate-as-fact. lexicons/k8s/src/composites/operator-stack.ts:214; test "deriveHostVerbClass: the destructive refusal names OPS014 and the unattended-approval reason" asserts /OPS014/, /unattended/ and no TMP014.
  • --durable-requests reads as reserved in cli/run.mdx and registry.ts. docs/src/content/docs/cli/run.mdx:191 and packages/core/src/cli/registry.ts:269.
  • context.ts matches resource-handlers.ts; the agent-integration diagram source and SVGs show op-approve. packages/core/src/cli/mcp/resources/context.ts:72-74 against resource-handlers.ts:158-166; docs/diagrams/agent-integration-surfaces.ir.json:24,33 and both tracked SVGs.
  • What could not be proven without a live fountain instance is recorded on Verify the hosted fountain path end to end once the acp runtime lands #2180. Verify the hosted fountain path end to end once the acp runtime lands #2180 (comment)

What was and was not verified for the fountain re-run

Verified offline, in lexicons/fountain/src/op/runtime.test.ts: the exact string posted to POST /api/conversations/:id/prompts is chant run alb-deploy --approver alex --url https://github.com/o/r/pull/1, and that same string, fed back through parseChantCommandLine, parses as kind: "op-run" with op: "alb-deploy" and both flags set. That test runs core's own parseArgs and resolveCommand, not a stub parser.

Not verified, because it needs a live instance: that the sandbox's chant run <op> can reach the chant/lifecycle orphan branch from inside the sandbox's checkout; that the re-run's turn completes rather than gating again; and whether conversation_busy is hit in practice when the approve command is issued while the first turn is still settling. All three are recorded on #2180 along with the closing chant run status step added to the getting-started walkthrough.

Diagram rebuild

bash scripts/build-diagrams.sh was run and reports both agent-integration SVGs copied to docs/public/diagrams/ (gitignored). It does not regenerate them: it renders .dot sources with graphviz and passes .svg files through as-is, and these two are pinhole renders (see 676338a), whose .dot source was deleted when they were repainted. pinhole is not installed here, so the two tracked SVGs were edited by hand to match the .ir.json. Both edited strings sit in left-anchored <text> elements inside their cards, so nothing re-centres: op-run · op-status · op-approve is one character longer than the old label and stays well inside the 237px card, and observable · gate-able is shorter than what it replaces.

Gates

All run from the worktree root at 76d5923.

Gate Result
npx vitest run packages/core lexicons/fountain lexicons/k8s 477 files, 8029 tests passed, 1 skipped (main: 8021 passed, so 8 new)
npx vitest run packages lexicons 1174 files passed, 3 skipped; 15682 tests passed, 30 skipped
npx tsc --noEmit -p packages/core/tsconfig.json clean, exit 0
npx tsx scripts/typecheck.ts 37 known failures, no regressions (37 baselined)
npx tsx scripts/check-lexicons.ts no untracked tier-1 failures
node scripts/depcheck.mjs no undeclared runtime dependencies
npx eslint packages/ 0 errors, 2 pre-existing warnings in meta/publish-metadata.test.ts
node scripts/lint-docs-sentences.mjs 4110 findings, no regressions, 1 below the 4111 baseline
node scripts/check-docs-diataxis.mjs 21 tutorial, 52 how-to, 58 reference, 34 explanation

The prose ratchet came out one below its baseline, from replacing an em dash in guide/operator.mdx with a sentence break. The baseline file is left at 4111 rather than ratcheted down, to keep this diff to the seven fixes.

The first cold run of the full suite timed out 9 tests across 5 files, all of them CLI-subprocess end-to-end tests with a 20s per-test limit (security-boundary, component-security-boundary, op/discover, mcp/server, commands/audit). Every one passes on a warm re-run, and the same targeted command on the main checkout at b111293 passes all 477 files in 40s against this worktree's cold 80s, so it is transform-cache warmth rather than the change. The numbers in the table are the warm runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_0148a4dPTErCBpmNy7J7933f

… re-run, and --profile back on chant run (#2192)

Seven leftovers from #2116 that are behaviour rather than prose, each proven
against main at 4853da2.

`chant approve <op> <gate> --approver <name>` dropped the name: `runApprove`
read only `ctx.args.actor`, so the ledger fell through to $GITHUB_ACTOR or
$USER while every example README teaches `--approver you`. It now reads
`approver ?? actor`, the precedence `chant run approve` has had since #2126.

`chant run approve <op> <gate> --on fountain` posted `chant run approve <op>
<gate>` onto the steward's thread. The ACP parser reads that as the approve
verb, so the sandbox wrote the same resolution a second time on its local
runtime and never re-applied the op. It now posts `chant run <op>`, still
carrying `--approver` and `--url`, which parses as an op run and re-reads the
gate from the ledger. A test asserts the prompt string and feeds it back
through `parseChantCommandLine`. The three docs pages and the getting-started
walkthrough follow; the walkthrough drops the local `chant approve` that wrote
the resolution twice and gains a closing `chant run status`. What a live
fountain instance is still needed to prove is recorded on #2180.

`-p/--profile` is back in `parseArgs` and `ParsedArgs`, threaded through
`OpRunStartOptions.profile` to the runtime seam. The fountain runtime picks the
named profile per run and refuses an undeclared name rather than falling back
to `defaultProfile`. `profiles.mdx` drops its `temporal.profiles` comparisons.

`test/azure-drift-e2e.sh` generated a config naming a lexicon that cannot
resolve and an `OpConfig` field that does not exist; both are gone.

The `OperatorStack` destructive-target refusal cited TMP014 and argued from the
local executor's inability to honour a gate, which OPS014's own header retires.
It now cites OPS014 and gives OPS014's reason.

`--durable-requests` reads as reserved in `cli/run.mdx` and `registry.ts`,
matching `cli/run.mdx:55` and the runtime that refuses it by name.

The MCP context bundle told agents `chant://ops` carries `taskQueue`, that the
runs resource is workflow history, and that ops have `chant-op-<name>` workflow
ids. It now matches `resource-handlers.ts`. The agent-integration diagram
source and both tracked SVGs show `op-approve` and drop "durable".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0148a4dPTErCBpmNy7J7933f
@lex00
lex00 merged commit d04d10c into main Sep 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant